package com.inforich.orderManage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.inforich.orderManage.mapper.TransportMapper;
import com.inforich.orderManage.domain.Transport;
import com.inforich.orderManage.service.ITransportService;

/**
 * 运输Service业务层处理
 *
 * @author hjm
 * @date 2022-10-26
 */
@Service
public class TransportServiceImpl extends ServiceImpl<TransportMapper, Transport> implements
    ITransportService {

  @Override
  public Page<Transport> pageTransport(Page<Transport> page, Map<String, Object> map) {
    return baseMapper.pageTransport(page, map);
  }

  @Override
  public List<Transport> listTransport(Map<String, Object> map) {
    return baseMapper.listTransport(map);
  }

  @Override
  public List<Transport> listByBookingIdAndDriverId(String bookingId, Long driverId) {
    Map<String, Object> map = new HashMap<>();
    map.put("bookingId", bookingId);
    map.put("driverId", driverId);
    return listTransport(map);
  }

  @Override
  public Transport getTransportById(String id) {
    return baseMapper.selectTransportById(id);
  }

  @Override
  public int insertTransport(Transport transport) {
    return baseMapper.insertTransport(transport);
  }

  @Override
  public int updateTransport(Transport transport) {
    return baseMapper.updateTransport(transport);
  }

  @Override
  public List<Transport> listByBookingId(String bookingId) {
    return baseMapper.listByBookingId(bookingId);
  }


}
